package fr.ants.controller;

import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

import fr.ants.controller.clock.Clock;
import fr.ants.model.Grid;
import fr.ants.view.MainFrame;

/** 
 * Entry point of the simulator.
 *
 * @author Vianney DUPOY DE GUITARD
 */
public class EntryPoint {

	/**
	 * Application entry point. Initializes the model, view and controller.
	 * @param args : non utilisé.
	 */
	public static void main(String... args) {
		try {
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} catch (ClassNotFoundException | InstantiationException
				| IllegalAccessException | UnsupportedLookAndFeelException e) {
			e.printStackTrace();
		}
		
		Grid grid = new Grid();
		Clock clock = new Clock(grid);
		MainFrame frame = new MainFrame(clock,grid);
		clock.addPropertyChangeListener(frame);
		clock.execute();
	}
}